package com.tledu.zyf.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;

import com.tledu.zyf.model.IPAndLocationPojo;
import com.tledu.zyf.service.IIpService;

@Service
public class IpService implements IIpService {
	@Autowired
	private JdbcTemplate jdbcTemplate;

	@Override
	public List<IPAndLocationPojo> list() {
		String sql = "select * from t_ip";
		return jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(
				IPAndLocationPojo.class));
	}
}
